/*
 * ToolButtonDelegate.h  0.4.0 / Dec 04, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef TOOLBUTTONDELEGATE_H
#define TOOLBUTTONDELEGATE_H

#include "Cute4jSwing.h"

#include "AbstractButtonDelegate.h"

// ToolButtonDelegate Class. ---------------------------------------------------

/*!
 * \brief ToolButton Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT ToolButtonDelegate : public AbstractButtonDelegate
{
  Q_OBJECT
protected:
  ToolButtonDelegate(JNIEnv *env, jobject obj);
public slots: // native calls
  void setMenu(JNIEnv *env, jlong menuDelegate);
  void setPopupMode(JNIEnv *env, jint popupMode);
  void setToolButtonStyle(JNIEnv *env, jint toolButtonStyle);
public: // native calls
  static jlong newInstance(JNIEnv *env, jobject obj);
public:
  inline QToolButton *qToolButton() const;
};

// ToolButtonDelegate :: Public Inline Member Function. ------------------------

/*!
 * \brief Returns QToolButton adaptee.
 *
 * \return QToolButton adaptee
 */
inline QToolButton *ToolButtonDelegate::qToolButton() const
{
  return static_cast<QToolButton *>(qObject());
}

// Macro Definitions. ----------------------------------------------------------

#define TOOL_BUTTON_DELEGATE (reinterpret_cast<ToolButtonDelegate *>(delegate))

#endif // TOOLBUTTONDELEGATE_H
